<?php
require_once("../data/db_connection.php");
require_once("../constants.php");
require_once("../Utils.php");

$db = new db();

$event_id = getFinalValue($_POST[PARAM_EVENT_ID]);
$users_count = getFinalValue($_POST[PARAM_USERS_COUNT]);

$str = "";
$str .= $users_count;

$multi_sql = "";

$return_str = false;
for ($i = 0; $i < $users_count; $i++) {
	$user_id = getFinalValue($_POST[PARAM_USER_ID . $i]);
	// 0表示 活动是由user_id创建， 1表示 未接受邀请， 2表示 接受邀请
	$multi_sql = "INSERT INTO pTableUserEvent VALUES(NULL, " . $user_id . ", " . $event_id . ", 1);";
	$return_str = $db->insert($multi_sql);	
}
echo $return_str;

$db->close();
?>